/**
 * All Rights Reserved , Copyright (C) 2021 , 青岛鼎信通讯股份有限公司
 *
 *SdProjectMilepostController
 * SD项目策划-里程碑
 *
 * 修改纪录
 * 2021-12-16 版本：1.0 hudeyong 创建。
 * @version 版本：1.0
 * @author 作者：hudeyong
 * 创建日期：2021-12-16
 */

package com.topscomm.gpm.controller;

import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.topscomm.base.service.impl.BaseChangeLogService;
import com.topscomm.basic.BasicEntity;
import com.topscomm.basic.util.SQLAdapter;
import com.topscomm.gpm.controller.auto.GpmProjectMilepostControllerAuto;
import com.topscomm.gpm.pojo.GpmMilePostTemplateEntity;
import com.topscomm.gpm.pojo.GpmProjectMilepostEntity;
import com.topscomm.gpm.pojo.GpmProjectTaskEntity;
import com.topscomm.gpm.service.impl.*;
import com.topscomm.pub.util.BaseUtil;
import com.topscomm.pub.util.ConvertUtil;
import com.topscomm.pub.util.OfficeOperateUtil;
import com.topscomm.pub.vo.Page;
import com.topscomm.pub.vo.Query;

import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


import cn.hutool.core.date.DateUtil;

import com.topscomm.pub.util.StringBufferProxy;
import com.topscomm.pub.util.StringUtil;
import com.topscomm.pub.vo.ResponseResult;

/**
 * @author: hudeyong
 * @date: 2021-12-16
 * @description:SD项目策划-里程碑Controller
 * @modify:
 */
@RestController
@RequestMapping("sd/projectMilepost")
public class GpmProjectMilepostController extends GpmProjectMilepostControllerAuto implements IGpmProjectMilepostController {

//    @Autowired
//    private SdProjectPlanService sdProjectPlanService;
    @Autowired
    private GpmMilePostTemplateService gpmMilePostTemplateService;
    @Autowired
    private GpmProjectMilepostService gpmProjectMilepostService;
    @Autowired
    private GpmProjectTaskService gpmProjectTaskService;
    @Autowired
    private BaseChangeLogService baseChangeLogService;
    @Autowired
    private GpmProjectService gpmProjectService;

//    @Autowired
//    private SdIndexController sdIndexController;

	/**
	 * @author: hudeyong
	 * @date: 2021-12-16
	 * @param paraMap
	 * @return
	 * @description:转换出查询SQL语句
	 * @modify:
	 */
    @Override
    protected String spellListSql(Map<String, Object> paraMap) {
        StringBufferProxy sql = new StringBufferProxy();
        sql.appendSingle(" 1=1 ");
        if (paraMap.containsKey("qry_planid")) {
            String value = paraMap.get("qry_planid").toString();
            if (!StringUtil.isEmpty(value)) {
                sql.appendSingle(" and planid = '{0}' ", value);
            }
        }
        //按照项目名称或编号查询
        if (paraMap.containsKey("qry_projectstr")) {
            String value = paraMap.get("qry_projectstr").toString();
            if (!StringUtil.isEmpty(value)) {
                sql.appendSingle(
                    " and EXISTS (SELECT PROJECTCODE from GPMPROJECT where GPMPROJECT.PROJECTCODE=GpmProjectMilepost.PROJECTCODE and  (PROJECTNAME like '%{0}%' or PROJECTCODE = '{0}'))  ",
                    value);
            }
        }
        //按照责任人名称或工号查询
        if (paraMap.containsKey("qry_responsiblestr")) {
            String value = paraMap.get("qry_responsiblestr").toString();
            if (!StringUtil.isEmpty(value)) {
                sql.appendSingle(" and (RESPONSIBLE like '%{0}%' or RESPONSIBLECODE ='{0}' )",
                    value);
            }
        }
        if (paraMap.containsKey("qry_operatecode")) {
            String value = paraMap.get("qry_operatecode").toString();
            if (!StringUtil.isEmpty(value)) {
                sql.appendSingle(" and operatecode = '{0}' ", value);
            }
        }
        if (paraMap.containsKey("qry_projectcode")) {
            String value = paraMap.get("qry_projectcode").toString();
            if (!StringUtil.isEmpty(value)) {
                sql.appendSingle(" and projectcode = '{0}' ", value);
            }
        }
        if (paraMap.containsKey("qry_projectid")) {
            String value = paraMap.get("qry_projectid").toString();
            if (!StringUtil.isEmpty(value)) {
                sql.appendSingle(" and projectid = '{0}' ", value);
            }
        }
        if (paraMap.containsKey("qry_operatecode")) {
            String value = paraMap.get("qry_operatecode").toString();
            if (!StringUtil.isEmpty(value)) {
                sql.appendSingle(" and operatecode = '{0}' ", value);
            }
        }
        if (paraMap.containsKey("qry_id")) {
            String value = paraMap.get("qry_id").toString();
            if (!StringUtil.isEmpty(value)) {
                sql.appendSingle(" and id = '{0}' ", value);
            }
        }
        if (paraMap.containsKey("qry_milepoststate")) {
            String value = paraMap.get("qry_milepoststate").toString();
            if (!StringUtil.isEmpty(value)) {
                sql.appendSingle(" and milepoststate = {0} ", value);
            }
        }
        if (paraMap.containsKey("qry_enabled")) {
            String value = paraMap.get("qry_enabled").toString();
            if (!StringUtil.isEmpty(value)) {
                sql.appendSingle(" and enabled = {0} ", value);
            }
        }
        if (paraMap.containsKey("qry_state")) {
            String value = paraMap.get("qry_state").toString();
            if (!StringUtil.isEmpty(value)) {
                sql.appendSingle(" and state = {0} ", value);
            }
        }
        if (paraMap.containsKey("qry_overdue")) {
            sql.appendSingle(" and  PLANFINISHTIME < {0} ",
                SQLAdapter.toDateShort(DateUtil.formatDate(new Date())));
        }
        if (paraMap.containsKey("qry_permission")) {
            String value = paraMap.get("qry_permission").toString();
            sql.appendSingle("and " + gpmProjectService
                .whereExistsSqlForIndex(GpmProjectMilepostEntity.tableName, GpmProjectMilepostEntity.FieldProjectid, value));
        }
        // 所属策划单审批状态
        if (paraMap.containsKey("qry_planapprovalstate")) {
            String value = paraMap.get("qry_planapprovalstate").toString();
            sql.appendSingle("and exists (select 1 from GPMProjectPlan p where " +
                    "GpmProjectMilepost.planid = p.id and p.state in ({0}))", value);
        }
        if (paraMap.containsKey("qry_name")) {
            String value = paraMap.get("qry_name").toString();
            if (!StringUtil.isEmpty(value)) {
                sql.appendSingle(" and milepostname like '%{0}%' ", value);
            }
        }
        return sql.toString();
    }

	/**
	 * @author: hudeyong
	 * @date: 2021-12-16
	 * @param paraMap
	 * @return
	 * @description:转换出查询SQL语句
	 * @modify:
	 */
    @Override
    @GetMapping(value = "/refList")
    public ResponseResult<Object> refList(
            @RequestParam(required = false) Map<String, Object> paraMap) {
        if (paraMap.get("viewAllMilePost").equals("true")) {
            return super.refList(paraMap);
        } else {
            paraMap = BaseUtil.decodeSecureMap(paraMap);
            Query query = new Query(paraMap);
            String sqlWhere = this.spellRefListSql(paraMap);
            StringBufferProxy str = new StringBufferProxy();
            str.appendSingle("{0} and responsiblecode = {1}", sqlWhere, ConvertUtil.convertToString(paraMap.get("currentUser")));
            int totalCount = this.service.getCount(str.toString());
            List<Map<String, Object>> tempList = null;
            if (query.getPageSize() > 0) {
                tempList = this.service.queryMapForPage(str.toString(), query.getCurrentPage(), query.getPageSize(), query.getSidx(), query.getSord());
            } else {
                tempList = this.service.queryMapByWhere(str.toString());
            }

            Page page = new Page(tempList, totalCount, query.getPageSize(), query.getCurrentPage());
            return ResponseResult.ok(page);
        }
    }

    /**
     * @description:
     * @author 范智明
     * @param paraMap
     * @return ResponseResult
     * @date 2021/6/28
     * @modify 辛福朔 添加初始里程碑添加
     */
   @PostMapping(value = "/insertBatch")
   public ResponseResult<Object> insertBatch(
       @RequestBody(required = false) Map<String, Object> paraMap) {
           this.service.insertBatch(paraMap);
           return ResponseResult.ok(paraMap);
   }


   /**
    * @author: wudaliang
    * @date: 2021-01-21
    * @param: paraMap
    * @description: 按照项目添加里程碑
    * @return: com.topscomm.pub.vo.ResponseResult<java.lang.Object>
    * @modify:
    */
   @PostMapping(value = "/insertFromProject")
   public ResponseResult<Object> insertFromProject(
       @RequestBody(required = false) Map<String, Object> paraMap) {
       try {
           ResponseResult responseResult = gpmProjectMilepostService.insertFromProject(paraMap);
           return responseResult;
       } catch (Exception ex) {
           return ResponseResult.error("插入里程碑出错，请联系管理员!");
       }
   }


   /**
    * @author: wudaliang
    * @date: 2021-01-21
    * @param: paraMap
    * @description: 按照模板添加里程碑
    * @return: com.topscomm.pub.vo.ResponseResult<java.lang.Object>
    * @modify:
    */
   @PostMapping(value = "/insertFromMilePostTemplate")
   public ResponseResult<Object> insertFromMilePostTemplate(
       @RequestBody(required = false) Map<String, Object> paraMap) {
       try {
           ResponseResult responseResult = gpmProjectMilepostService
               .insertFromMilePostTemplate(paraMap);
           return responseResult;
       } catch (Exception ex) {
           return ResponseResult.error("插入里程碑出错，请联系管理员!");
       }
   }


   /**
    * @author: wudaliang
    * @date: 2021-01-29
    * @param: dataMap
    * @param: paraMap
    * @description: 修改新的策划书中从老策划书带过来的旧版里程碑后，回写旧版里程碑下的任务中的里程碑名称
    * @return: void
    * @modify:
    */
   @Override
   protected void afterUpdate(Map<String, Object> dataMap, Map<String, Object> paraMap)
       throws Exception {
       super.afterUpdate(dataMap, paraMap);
       Long operatecode = (long) paraMap.get("operatecode");
       StringBufferProxy sql = new StringBufferProxy();
       sql.appendSingle("milepostcode  = {0}", operatecode);
       List<GpmProjectTaskEntity> sdProjectTaskEntities = gpmProjectTaskService
           .queryByWhere(sql.toString());
       if (sdProjectTaskEntities.size() > 0) {
           for (GpmProjectTaskEntity e : sdProjectTaskEntities) {
               e.setMilepostname(paraMap.get("milepostname").toString());
               gpmProjectTaskService.updateEntity(e);
           }
       }
   }

   /**
    * @author: hudeyong
    * @date: 2021-01-29
    * @param: dataMap
    * @param: paraMap
    * @description: 加载里程碑相关信息
    * @return: void
    * @modify:
    */
	@GetMapping(value = "/milepostLoadInfo")
	public ResponseResult<Object> milepostLoadInfo(@RequestParam(required = false) Map<String, Object> paraMap) {
		String planid = ConvertUtil.convertToString(paraMap.get("id"));
		StringBufferProxy sql = new StringBufferProxy();
		// 修改默认排序字段为planfinishtime(计划达成日期)
		sql.appendSingle("planid = {0} order by planfinishtime asc,id asc",planid);
       List<Map<String,Object>> milepostList = new ArrayList<>();
       // 获取里程碑信息
		List<GpmProjectMilepostEntity> milepostEntities = this.service.queryByWhere(sql.toString());
		// 如果没有里程碑信息，直接return
		if(milepostEntities.size() <= 0) {
           paraMap.put("milepostList", milepostList);
           return ResponseResult.ok(paraMap);
       }
       String milepostcodeStr = milepostEntities.stream().map(item -> "'" + ConvertUtil.convertToString(item.getOperatecode()) + "'").collect(Collectors.joining(","));
       sql.clear();
       int index = 0;
       for(GpmProjectMilepostEntity milepostEntity : milepostEntities) {
    	   if(index == 0) {
    		   sql.appendSingle("taskstate > 0 and ( ");
    	   }
    	   index++;
    	   sql.appendSingle("(milepostcode = '{0}' and milepostversion <= {1}) ",
    			   milepostEntity.getOperatecode(),milepostEntity.getVersion());
    	   if(index<milepostEntities.size()) {
    		   sql.appendSingle(" or ");
    	   } else {
    		   sql.appendSingle(" )");
    	   }
       }
//       sql.appendSingle("milepostcode in ({0}) and taskstate > 0",milepostcodeStr);
       // 获取里程碑下的所有非未开始任务信息
       List<GpmProjectTaskEntity> sdProjectTaskEntities = gpmProjectTaskService.queryByWhere(sql.toString());
       // 将任务信息按照里程碑进行分类
       Map<String,List<GpmProjectTaskEntity>> sdProjectTaskMap = sdProjectTaskEntities.stream().collect(Collectors.groupingBy(GpmProjectTaskEntity::getMilepostcode));
       milepostEntities.stream().forEach(item -> {
           Map<String,Object> milepostmap = item.convertToMap();
           // 判断里程碑是否为模板里程碑
           this.beforeLoadInfo(milepostmap);
           String milepostcode = ConvertUtil.convertToString(item.getOperatecode());
           // 如果该里程碑没有任务或任务都没有开始，允许用户删除此里程碑
               if(sdProjectTaskMap.get(milepostcode) == null) {
                   milepostmap.put("enableDelete",true);
               } else {
                   milepostmap.put("enableDelete",false);
               }
               milepostList.add(milepostmap);
       });
		paraMap.put("milepostList", milepostList);
		return ResponseResult.ok(paraMap);
   }
	   /**
     * @description:
     * @author xinfushuo
     * @param entityMap 里程碑entity转化的map
     * @date 2021/10/19
     * @modify
     */
    private void beforeLoadInfo(Map<String,Object> entityMap ){
        GpmMilePostTemplateEntity template = gpmMilePostTemplateService.queryById(ConvertUtil.convertToString(entityMap.get("sourceid")));
        if(template!=null){
            entityMap.put("templatetype", "template");
        }

    }
   /**
    * @author: hudeyong
    * @date: 2021-01-29
    * @param: dataMap
    * @param: paraMap
    * @description: 保存全部里程碑
    * @return: void
    * @modify:
    */
	@PostMapping(value = "/updateInfo")
    public ResponseResult<Object> updateInfo(@RequestBody(required = false) Map<String, Object> paraMap) {
        try {
        	List<Map<String, Object>> milepostList = (List<Map<String, Object>>) paraMap.get("milepostList");
        	StringBufferProxy sql = new StringBufferProxy();
        	String projectcode = ConvertUtil.convertToString(paraMap.get("projectcode"));
        	String planid = ConvertUtil.convertToString(paraMap.get("planid"));
        	List<BasicEntity> batchInsert = new ArrayList<BasicEntity>();
        	List<Map<String,Object>> batchUpdate = new ArrayList<Map<String,Object>>();
        	for(Map<String, Object> map : milepostList) {
        		if(map.containsKey("milepostcode")) {
                    batchUpdate.add(map);
        		}else {
        			map.put("id", "");
        			map.put("projectcode", projectcode);
        			map.put("planid", planid);
        			BasicEntity milepostEntity = new GpmProjectMilepostEntity();
        			milepostEntity = milepostEntity.convertFromMap(map);
                    batchInsert.add(milepostEntity);
        		}
        		//查询是否有大于里程碑计划达成日期的未完成的任务
//                if(map.containsKey("planfinishtime") && !StringUtil.isEmpty(map.get("planfinishtime").toString())){
//                    StringBufferProxy countSql = new StringBufferProxy();
//                    countSql.appendSingle("milepostcode = '{0}'", map.get("operatecode"));
//                    countSql.appendSingle(" and taskstate in ('0','1') and (planenddate > {0} or planstartdate > {0})", SQLAdapter.toDateLong(map.get("planfinishtime").toString()));
//                    int count = sdProjectTaskService.getCount(countSql.toString());
//                    if (count > 0) {
//                        return ResponseResult.error("任务的计划开始日期、计划完成日期不能大于里程碑计划达成日期！");
//                    }
//                }
        		sql.clear();
    			sql.appendSingle("milepostcode = '{0}'", map.get("operatecode"));
    			List<Map<String, Object>> sdProjectTaskEntities = gpmProjectTaskService.queryMapByWhere(sql.toString());
    			if(sdProjectTaskEntities.size()>0) {
//        			if("0".equals(map.get("isdelivery"))) {
//	    				List<Map<String, Object>> tasks = new ArrayList<Map<String, Object>>();
//	    				for(Map<String, Object> taskEntity : sdProjectTaskEntities) {
//	    					taskEntity.put("productline", null);
//	    					taskEntity.put("productbigtype", null);
//	    					taskEntity.put("productmiddletype", null);
//	    					taskEntity.put("productname", null);
//	    					taskEntity.put("amount", null);
//	    					taskEntity.put("fund", null);
//	    					tasks.add(taskEntity);
//	    				}
//	    				sdProjectTaskService.updateBatchMap(tasks);
//        			}
    			}
        	}
        	this.service.insertBatch(batchInsert);
        	this.service.updateBatchMap(batchUpdate);
            return ResponseResult.ok("ok");
        } catch (Exception ex) {
            return ResponseResult.error("插入里程碑出错，请联系管理员!");
        }
    }

   /**
    * @author: hudeyong
    * @date: 2021-01-29
    * @param: dataMap
    * @param: paraMap
    * @description: 保存某个里程碑
    * @return: void
    * @modify:
    */
	@PostMapping(value = "/saveMilepost")
   public ResponseResult<Object> saveMilepost(@RequestBody(required = false) Map<String, Object> paraMap) {
       try {
       	Map<String, Object> milepost = (Map<String, Object>) paraMap.get("milepost");
       	String projectcode = ConvertUtil.convertToString(paraMap.get("projectcode"));
       	String planid = ConvertUtil.convertToString(paraMap.get("planid"));
   		if(milepost.containsKey("id")) {
   			this.service.updateByWhere(milepost, "id = "+ ConvertUtil.convertToString(milepost.get("id")));
   		}else {
   			milepost.put("id", "");
   			milepost.put("newadd", "1");
   			milepost.put("projectcode", projectcode);
   			milepost.put("planid", planid);
   			BasicEntity milepostEntity = new GpmProjectMilepostEntity();
   			milepostEntity = milepostEntity.convertFromMap(milepost);
   			this.service.insert(milepostEntity);
   			return ResponseResult.ok(milepostEntity);
   		}
           return ResponseResult.ok("ok");
       } catch (Exception ex) {
           return ResponseResult.error("插入里程碑出错，请联系管理员!");
       }
   }

   @PostMapping(value = "/updateMilepostBatch")
   public ResponseResult<Object> updateMilepostBatch(@RequestBody(required = false) Map<String, Object> paraMap){

           List<Map<String, Object>> milepostList = (List<Map<String, Object>>) paraMap.get("milepostList");
           ArrayList<BasicEntity> basicEntities = new ArrayList<>();
           milepostList.forEach(item->{
               BasicEntity milepostEntity = new GpmProjectMilepostEntity();
               milepostEntity = milepostEntity.convertFromMap(item);
               basicEntities.add(milepostEntity);
           });
           this.service.updateBatch(basicEntities);
           return ResponseResult.ok("ok");
   }
   /**
     * @description:
     * @author xinfushuo
     * @param
     * @throws
     * @return
     * @date 2021/10/18
     * @modify
     */
   @Override
   @GetMapping(value = "/dataCodeList")
   public ResponseResult<Object> dataCodeList(@RequestParam(required = false) Map<String, Object> paraMap) {
       Map<String, Object> codeMap = new HashMap<String, Object>();
       List<Map<String, Object>> projectlevelList = datacodeCache.getCodeListMap("GpmProjectLevel", "", "sortcode");
       codeMap.put("projectlevelList", projectlevelList);
       List<Map<String, Object>> projecttypeList = datacodeCache.getCodeListMap("GpmProjectType", "", "sortcode");
       codeMap.put("projecttypeList", projecttypeList);
       List<Map<String, Object>> enabledList = datacodeCache.getCodeListMap("CboYesNo", "", "sortcode");
       codeMap.put("enabledList", enabledList);
       super.dataCodeList(paraMap);
       return ResponseResult.ok(codeMap);
   }
   /**
     * @description: 获取标前引导的里程碑
     * @author xinfushuo
     * @param paraMap :  projectcode
     * @throws
     * @return
     * @date 2021/10/18
     * @modify
     */
   @GetMapping(value = "/bidGuideList")
   public ResponseResult<Object> bidGuideList(@RequestParam(required = false) Map<String,Object> paraMap){
       if(paraMap.get("projectcode")!=null) {
           List<Map<String, Object>> dataList = this.service.queryTaskListByType(ConvertUtil.convertToString(paraMap.get("projectcode")),"1");
           Map<String, Object> dataMap = new HashMap<>();
           dataMap.put("dataList", dataList);
           return ResponseResult.ok(dataMap);
       }
       return ResponseResult.ok(paraMap);
   }
   /**
     * @description:
     * @author xinfushuo
     * @param
     * @throws
     * @return
     * @date 2021/10/19
     * @modify
     */
   @PostMapping(value = "/exportBidGuideExcel")
   public ResponseResult<Object> exportBidGuideExcel(@RequestBody(required = false) Map<String,Object> paraMap, HttpServletRequest request, HttpServletResponse response)  {
       paraMap = BaseUtil.decodeSecureMap(paraMap);
       String cols = ConvertUtil.convertToString(paraMap.get("cols"));
       String projectcode = ConvertUtil.convertToString(paraMap.get("projectcode"));
       String fileName = ConvertUtil.convertToString(paraMap.get("fileName"));
       fileName = fileName.length() == 0 ? "".concat(projectcode)+"标前引导.xlsx" : fileName + ".xlsx";
       InputStream inputStream = null;

       //获取inputstream
       List<Map<String,Object>> listDataMap = this.service.queryTaskListByType(projectcode,"1");
       try {
            inputStream = OfficeOperateUtil.exportExeclXlsx(listDataMap, cols.split(","));
           response.setContentType("application/vnd.ms-excel");
           response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
           response.setHeader("istaskexport", "0");
           // 需要添加否则前台得不到istaskexport
           response.setHeader("Access-Control-Expose-Headers", "istaskexport");
           response.setHeader("FileName", URLEncoder.encode(fileName, "utf-8"));
           response.setHeader("Access-Control-Expose-Headers", "FileName");
           OutputStream outStream = response.getOutputStream();
           byte[] bytes = new byte[2048];
           int len;
           while ((len = inputStream.read(bytes)) != -1) {
               outStream.write(bytes, 0, len);
           }
           inputStream.close();
           return null;
       } catch (Exception e) {
           return handleControllerException(e);
       }
   }
   /**
    * @description:重写list
    * @author zhangjunyao
    * @param
    * @throws
    * @return ResponseResult
    * @date 2021/12/10
    * @modify
    */
   @Override
   @GetMapping({"/list"})
   public ResponseResult<Object> list(@RequestParam(required = false) Map<String, Object> paraMap) {
       try {
           paraMap = BaseUtil.decodeSecureMap(paraMap);
           Query query = new Query(paraMap);
           String sqlWhere = this.spellListSql(paraMap);
           int totalCount = this.service.getCount(sqlWhere);
           List<Map<String, Object>> tempList = null;
           if (query.getPageSize() > 0) {
               tempList = this.service.queryMapForPage(sqlWhere, query.getCurrentPage(), query.getPageSize(), query.getSidx(), query.getSord());
           } else {
               tempList = this.service.queryMapByWhere(sqlWhere);
           }
           if (CollectionUtils.isEmpty(tempList)) {
               return ResponseResult.ok(new Page(tempList, totalCount, query.getPageSize(), query.getCurrentPage()));
           }
           // 项目追踪模块下里程碑需要查询督办情况
           if (paraMap.containsKey("qry_superviselist")) {
               this.service.getSuperviseList(tempList);
           }
           // 超期里程碑需要查询项目相关信息与未完成任务
           if (paraMap.containsKey("qry_overdue")) {
               this.service.getProjectInfo(tempList);
               this.service.getUnfinishedTask(tempList);
               this.service.getMilepostOverdueDate(tempList);
           }
           Page page = new Page(tempList, totalCount, query.getPageSize(), query.getCurrentPage());
           return ResponseResult.ok(page);
       } catch (Exception var7) {
           return this.handleControllerException(var7);
       }
   }
}

